﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Alos.Entity;
using Alos.IRepository;
using PetaPoco;

namespace Alos.Repository
{
    public class AssessmentCriteriaRepository : BaseRepository<AssessmentCriterium>, IAssessmentCriteriaRepository
    {
        /// <summary>
        /// 根据教师ID获取已启用的用户指标
        /// </summary>
        /// <param name="TeacherId">教师ID</param>
        /// <returns></returns>
        public IEnumerable<dynamic> GetAssessmentCriteriaByTeacherId(int TeacherId, int Type)
        {
            var sql = Sql.Builder.Append(" select * from AssessmentCriteria where TeacherId=@0 and IsActive=1 and Type=@1", TeacherId, Type);       
            return DBContext.Query<dynamic>(sql);
        }
    }
}
